﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<skags.Models.PollModels>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Taka þátt í könnun
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<div id="main">
<h2><%: Model.Question %></h2>
<%
    if (Request.Cookies["Brjostagjof_" + Model.id] != null)
        Response.Write("Þú ert búinn að kjósa í þessari könnun.");
    else
    {
    using (Html.BeginForm()) { %>
    <%= Html.HiddenFor(m => m.id) %>
        <%: Html.ValidationSummary(true, "Ekki tókst að vista svar. Vinsamlegast farið yfir það sem var sett inn og reynið aftur.") %>
            <table border="1">
                <tr>
                    <th>
                            Svar
                    </th>
                    </tr>
                <tr>
                    <td>
                        <% if (Model.Option1 != null) %>
                        <% { %>
                            <input type="radio" name="Opt" id="Radio1" value="Vote1"><%: Model.Option1 %><br>
                        <% } %>
                        <% if (Model.Option2 != null) %>
                        <% { %>
                            <input type="radio" name="Opt" id="Radio2" value="Vote2"><%: Model.Option2 %><br>
                        <% } %>
                        <% if (Model.Option3 != null) %>
                        <% { %>
                            <input type="radio" name="Opt" id="Radio3" value="Vote3"><%: Model.Option3 %><br>
                        <% } %>
                        <% if (Model.Option4 != null) %>
                        <% { %>
                            <input type="radio" name="Opt" id="Radio4" value="Vote4"><%: Model.Option4 %><br>
                        <% } %>
                        <% if (Model.Option5 != null) %>
                        <% { %>
                            <input type="radio" name="Opt" id="Radio5" value="Vote5"><%: Model.Option5 %><br>
                        <% } %>
                    </td>
                </tr>
                <br />
            </table>
            <br />
                <input type="submit" name="submit_poll" value="Kjósa" /><br /><br />
                <a href="/Poll/Latest">Skoða niðurstöður</a><br />
                <a href="/Poll/Polls">Skoða eldri kannanir</a>
    <% }
    } %>
    </div>
</asp:Content>
